<?php
$banner = file_get('json', 'slideshow');
if (!empty($banner)) {
?>
<div id="banner-global" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <?php
      foreach ($banner as $key => $val) {
        echo '<li data-target="#banner-global" data-slide-to="' . $key . '" class="' . ($key == 0 ? 'active' : '') . '"></li>';
      }
      ?>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <?php
      foreach ($banner as $key => $val) {
        echo '<div class="item ' . ($key == 0 ? 'active' : '') . '">
        <img src="' . $val['s_picture'] . '" alt="' . $val['s_name'] . '" />
        <div class="carousel-caption hidden">
          ' . $val['s_name'] . '
        </div>
      </div>';
      }
      ?>
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#banner-global" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#banner-global" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

<div class="clearfix"></div>
<?php } ?>